import {createMemoryHistory, createRouter} from 'vue-router'
import Login from "../views/Login.vue";
import Main from "../views/Main.vue";
import UserInfo from "../views/user-regulate/UserInfo.vue";
import LogInfo from "../views/user-regulate/LogInfo.vue";
import RoleInfo from "../views/user-regulate/RoleInfo.vue";
import RoleInfoAdd from "../views/user-regulate/RoleInfoAdd.vue";
import Home from "../views/Home.vue";

import Investors from "../views/Franchise-cooperation/Investors.vue";
import ContractManagement from "../views/Franchise-cooperation/ContractManagement.vue";
import Todo from "../views/Franchise-cooperation/Todo.vue";
import TodoDialog from "../views/Franchise-cooperation/TodoDialog.vue";

import ActivityInfo from "../views/Operational-promotion/ActivityInfo.vue";
import Coupons from "../views/Operational-promotion/Coupons.vue";
import Customers from "../views/Operational-promotion/Customers.vue";
import GroupInfo from "../views/Operational-promotion/GroupInfo.vue";
import InvitationInfo from "../views/Operational-promotion/InvitationInfo.vue";

import RiskManagement from "../views/risk_fault/risk/RiskManagement.vue";
import RiskTreatment from "../views/risk_fault/risk/RiskTreatment.vue";
import AdminRiskTreatment from "../views/risk_fault/risk/AdminRiskTreatment.vue";

import AdminFaultTreatment from "../views/risk_fault/fault/AdminFaultTreatment.vue";
import FaultManagement from "../views/risk_fault/fault/FaultManagement.vue";
import FaultTreatment from "../views/risk_fault/fault/FaultTreatment.vue";



import ChargingTable from "../views/ChargingManagement/ChargingTable.vue";
import RechargeTable from "../views/ChargingManagement/RechargeTable.vue";
import TransactionTable from "../views/ChargingManagement/TransactionTable.vue";


import UploadComponent from "../views/test/UploadComponent.vue";
import StationManagement from "../views/station-related/StationManagement.vue";
import ChargingPileManagement from "../views/station-related/ChargingPileManagement.vue";
//2、配置路由表信息
const routes = [

    {
        path: '/login',
        name: 'login',
        component: Login,
        meta: {requiresAuth: false}, // 标记此路由不需要认证
    }
    ,
    {
        path: '/',
        name: 'main',
        component: Main,
        meta: {requiresAuth: true}, // 标记此路由需要认证
        children: [
            {
                path: '',
                name: 'home',
                component: Home
            },
            {
                path: '/userInfo',
                name: 'userInfo',
                component: UserInfo
            },
            {
                path: '/contractManagement',
                name: 'contractManagement',
                component: ContractManagement
            }, {
                path: '/investors',
                name: 'investors',
                component: Investors
            },
            {
                path: '/riskManagement',
                name: 'riskManagement',
                component: RiskManagement
            }
            , {
                path: '/rechargeTable',
                name: 'rechargeTable',
                component: RechargeTable
            }, {
                path: '/ActivityInfo',
                name: 'ActivityInfo',
                component: ActivityInfo
            }
            , {
                path: '/Coupons',
                name: 'Coupons',
                component: Coupons
            }
            , {
                path: '/Customers',
                name: 'Customers',
                component: Customers
            }
            , {
                path: '/GroupInfo',
                name: 'GroupInfo',
                component: GroupInfo
            }
            , {
                path: '/InvitationInfo',
                name: 'InvitationInfo',
                component: InvitationInfo
            }
            , {
                path: '/ChargingPile',
                name: 'ChargingPile',
                component: ChargingPileManagement
            }
            , {
                path: '/station',
                name: 'station',
                component: StationManagement
            }
            , {
                path: '/testImgUpload',
                name: 'testImgUpload',
                component: UploadComponent
            }, {
                path: '/RoleInfo',
                name: 'RoleInfo',
                component: RoleInfo
            }
            , {
                path: '/RoleInfoAdd',
                name: 'RoleInfoAdd',
                component: RoleInfoAdd
            }
            , {
                path: '/LogInfo',
                name: 'LogInfo',
                component: LogInfo
            }
            , {
                path: '/RiskTreatment',
                name: 'RiskTreatment',
                component: RiskTreatment
            }
            , {
                path: '/AdminRiskTreatment',
                name: 'AdminRiskTreatment',
                component: AdminRiskTreatment
            }
            , {
                path: '/AdminFaultTreatment',
                name: 'AdminFaultTreatment',
                component: AdminFaultTreatment
            }
            , {
                path: '/FaultManagement',
                name: 'FaultManagement',
                component: FaultManagement
            }
            , {
                path: '/FaultTreatment',
                name: 'FaultTreatment',
                component: FaultTreatment
            }
            , {
                path: '/ChargingTable',
                name: 'ChargingTable',
                component: ChargingTable
            }
            , {
                path: '/TransactionTable',
                name: 'TransactionTable',
                component: TransactionTable
            }
            , {
                path: '/Todo',
                name: 'Todo',
                component: Todo
            }
            , {
                path: '/TodoDialog',
                name: 'TodoDialog',
                component: TodoDialog
            }

        ]
    }


]
//创建路由器
const router = createRouter({
    history: createMemoryHistory(),
    routes,
})


export {router}